/**
 * Created by ospip on 2017/11/28.
 * Copyright (c) 2017 LLAP. All rights reserved.
 */
public class User {
    // Args: Queue+Priority+number
    // Example: A10001, B0002
    protected String name;
    protected int priority = 0;
    protected int order = 0;

    public User(String name, int priority) {
        this.name = name;
        this.priority = priority;
        order = Integer.parseInt(name.substring(2));
    }

    public int getOrder() {
        return order;
    }

    public void setOrder(int order) {
        this.order = order;
    }

    public User(String name) {
        this(name, Integer.parseInt(name.charAt(1) + ""));
    }

    public User() {
        this("", 0);
    }

    public String getName() {
        return name;
    }

    public int getPriority() {
        return priority;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", priority=" + priority +
                '}';
    }
}
